package com.yt.ootest.Observer.CrudeOilFutures;

import java.util.Observable;
import java.util.Observer;

/**
 * Created by Administrator on 2019/2/7 23:14
 */
public class Bear  implements Observer {
    @Override
    public void update(Observable o, Object arg) {
        Float price=((Float)arg).floatValue();
        if(price>0)
        {
            System.out.println("油价上涨"+price+"元，空方伤心了！");
        }
        else
        {
            System.out.println("油价下跌"+(-price)+"元，空方高兴了！");
        }
    }
}
